<div>
    <fieldset>
        <legend>Параметры атрибута</legend>
        <table>

            <tr><td></td><td class="ErrorMessage" data-field="log"></td></tr>
            <tr>
                <td>Название атрибута</td>
                <td><input class="Text" type="text" id="name"/></td>
            </tr>
            <tr><td></td><td class="ErrorMessage" data-field="name"></td></tr>

            <tr>
                <td>Тип атрибута</td>
                <td><?php echo $this->FieldTypes()->ToHtml(); ?></td>
            </tr>
        </table>

    </fieldset>

    <div class="ControlPanel">
        <button id="AddField">Сохранить</button>
        <button id="CancelAdd">Отмена</button>
    </div>

    <script type="text/javascript">
        jsun.run(function() {
        //////////////////////////////////////////////////////

        jsun("#AddField").jsun.event({ onclick: AddField });
        jsun("#CancelAdd").jsun.event({ onclick: CancelAdd });

        function CancelAdd() {
            return jsun.dialog.active.close();
        }

        function AddField() {
            var param = "u=Edition/AddField" + jsun.page.get_data();

            jsun.json.load(function(p) {
                if (p.STAT == 'OK') {
                    window.location.reload();
                } else {
                    jsun.show_err(p);
                }
            }, param);
        }

        ///////////////////////////////////////////////////////
        });
    </script>
</div>